package org.example.rabbitmq.client.rpc;

import java.io.IOException;
import java.time.LocalDateTime;
import java.util.concurrent.TimeoutException;

public class RPCTest {
    public static void main(String[] args) throws IOException, TimeoutException, InterruptedException {
        RPCServer server = new RPCServer();
        RPCClient client1 = new RPCClient();
        RPCClient client2 = new RPCClient();
        server.start();
        String result1 = client1.request("client1 " + LocalDateTime.now().toString());
        System.out.println("client1: " + result1);
        String result2 = client2.request("client2 " + LocalDateTime.now().toString());
        System.out.println("client2: " + result2);

        server.shutdown();
        client1.close();
        client2.close();
    }
}
